package com.sobey.web.core;

import javax.servlet.http.HttpServletRequest;

import org.apache.log4j.Logger;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.handler.SimpleMappingExceptionResolver;

public class SB_SimpleMappingExceptionResolver extends SimpleMappingExceptionResolver {
	private static final Logger logger = Logger
			.getLogger(SB_SimpleMappingExceptionResolver.class);
	
	@Override
	protected ModelAndView getModelAndView(String viewName, Exception ex,
			HttpServletRequest request) {
		logger.error("run time exception:", ex);//将异常信息打印到日志中
		return super.getModelAndView(viewName, ex, request);
	}
}
